package org.caowei.samples.model;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
@Entity
@Table(name = "exam_subject")
public class Subject implements Serializable{

	private static final long serialVersionUID = 1L;
	@Id
	@Column(name="sub_id",nullable = false)
	@NotNull(message = "不能为空！")
	private Integer subId;
	
	@Column(name="name")
	private String subName;
	
	@Column(name="description")
	private String description;
	
	@Column(name="test_count")
	private Integer testCount;
	
	@Column(name="total_time")
	private Integer totalTime;
	
	@Column(name="total_score")
	private Integer totalScore;
	
	@Column(name="status")
	private Integer status;

	@OneToMany(mappedBy = "subject")
	private Set<UserSubject> UserSubject;
	
	@OneToMany(mappedBy = "subject1")
	private Set<ExamTest> examTest;
	
	
	public Subject(Integer subId, Set<org.caowei.samples.model.UserSubject> userSubject, String subName,
			String description, Integer testCount, Integer totalTime, Integer totalScore, Integer status) {
		super();
		this.subId = subId;
		UserSubject = userSubject;
		this.subName = subName;
		this.description = description;
		this.testCount = testCount;
		this.totalTime = totalTime;
		this.totalScore = totalScore;
		this.status = status;
	}

	public Subject(){
		super();
	}
	
	public Integer getSubId() {
		return subId;
	}
	public void setSubId(Integer subId) {
		this.subId = subId;
	}
	public String getSubName() {
		return subName;
	}
	public void setSubName(String subName) {
		this.subName = subName;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Integer getTestCount() {
		return testCount;
	}
	public void setTestCount(Integer testCount) {
		this.testCount = testCount;
	}
	public Integer getTotalTime() {
		return totalTime;
	}
	public void setTotalTime(Integer totalTime) {
		this.totalTime = totalTime;
	}
	public Integer getTotalScore() {
		return totalScore;
	}
	public void setTotalScore(Integer totalScore) {
		this.totalScore = totalScore;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
}
